package com.coffee.core.enums;

public enum ResourceBucketEnum {
	WJYX_PUBLIC("wjyx-public","共有桶"),
	WJYX_PRIVATE("wjyx-private","私有桶"),
	WJYX_CONTRACTS("wjyx-contracts","合同桶");
	
	private String code;
	private String name;
	private ResourceBucketEnum(String code, String name) {
		this.code=code;
		this.name=name;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	
	public static ResourceBucketEnum getByCode(String code) {
		for(ResourceBucketEnum item:values()) {
			if(item.getCode().equals(code)) {
				return item;
			}
		}
		
		return WJYX_PUBLIC;
	}
	
}
